package com.zx.cloud.job;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.zx.cloud.common.filter.limit.LimiterStatsService;
import com.zx.cloud.common.filter.limit.LimiterStatsService.LimiterCallback;
import com.zx.cloud.common.filter.limit.LimiterStatsService.LimiterContext;
import com.zx.cloud.domain.ScheduleJob;

/**
 * 计划任务执行处 无状态
 */
public class QuartzJobFactory implements Job {

	public final Logger log = Logger.getLogger(this.getClass());

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		System.out.println("-----------------------execute-----------------------------");
//		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
//		String key = scheduleJob.getJobGroup() + scheduleJob.getJobName();
//		LimiterStatsService.getInstance().execute(key, 1, 1,new LimiterCallback() {
//
//			@Override
//			public void noexecute(LimiterContext limiterContext) {
//			}
//
//			@Override
//			public void execute(LimiterContext limiterContext) {
//				TaskUtils.invokMethod(scheduleJob);
//			}
//		});
	}
}